import { PromiseData } from '@/@types/request'
import request from '@/utils/request'
import { IWardList, CardList, IList } from '../type/hospital'
import { IYearList } from '../type'

// 获取医院基础信息
export const getVariableById = (data: {
  hospitalCode: number
}): Promise<PromiseData<{ hospitalApplyTime: string; quarterNow: string }>> =>
  request.post('/TimeQuarter/searchHospitalApplyData', data)

// 获取季度信息
export const getQuarter = (): Promise<PromiseData<IYearList[]>> => request.get('/TimeQuarter/searchYear')

// 获取可选病区
export const getWard = (data: {
  hospitalCode: number
  dataReportYear: string
  dataReportQuarter: string
}): Promise<PromiseData<[]>> => request.post('/TimeQuarter/searchWord', data)

// 根据筛选查看病区填报信息
export const getList = (data: any): Promise<PromiseData<IList>> =>
  request.post('/dataReport/hospitalSearchDataLists', data)

// 获取卡片信息
export const getCardList = (): Promise<PromiseData<CardList[]>> => request.get('/cardList')
